<div class="chat-box">
  <div class="chat-output">
    @for (msg of messages; track $index) {
      <div class="chat-line">
        <div class="chat-message" [ngClass]="{'chat-me':msg.type==='msg'}"
             [style]="msg.color?'color:'+msg.color:''">
          {{ msg.msg }}
        </div>
        @if (msg.type === 'msgAnswer' && !msg.isDone) {
          <div class="chat-wait-for-done">...</div>
        }
      </div>
    }
  </div>
  <div class="chat-footer">
    <nz-input-group nzSearch nzSize="large" [nzAddOnAfter]="suffixButton">
      <input type="text" nz-input placeholder="输入要发送的文字"
             [(ngModel)]="messageInput" (keyup.enter)="sendMessage()"/>
    </nz-input-group>
    <ng-template #suffixButton>
      <button nz-button nzType="primary" nzSize="large" nzSearch (click)="sendMessage()">发送</button>
    </ng-template>
  </div>
</div>
